package com.lizhi.yun.core.trajectorySelf;/**
 * @program: hbsf_yun
 * @name RszTrajectorySelfHandler
 * @description: 自定义处方
 * @author: lizhi
 * @create: 2021-11-17 09:21
 */

import com.lizhi.common.yun.entity.ListResponseResult;
import com.lizhi.mybatis.interceptor.PageBounds;
import com.lizhi.utils.json.SamJsonUtil;
import com.lizhi.yun.db.rsz.dao.RszTrajectorySelfDao;
import com.lizhi.yun.db.rsz.entity.RszTrajectorySelfEntity;
import com.lizhi.yun.deploy.NewBaseHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 *@program: hbsf_yun
 *@name RszTrajectorySelfHandler
 *@description: 自定义处方
 *@author: lizhi
 *@create: 2021-11-17 09:21
 */
@Slf4j
@Service
public class RszTrajectorySelfHandler extends NewBaseHandler {

    @Resource
    private RszTrajectorySelfDao rszTrajectorySelfDao;

    public ListResponseResult doMain(String json) {
        Map<String, Object> map = SamJsonUtil.toMap(json);
        PageBounds pageBounds = getPageBounds(map);
        List<RszTrajectorySelfEntity> rszTrajectorySelfEntities = rszTrajectorySelfDao.selectByMap(map, pageBounds);
        return getListResult(pageBounds.getCountRows(), rszTrajectorySelfEntities, map);
    }
}
